<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品列表页面</title>
<link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="wrap">
<!-- main begin-->
  <div class="sale">
    <h1 class="lf">在线拍卖系统</h1>
    <div class="logout right"><a href="#" title="注销">注销</a></div>
  </div>
  <div class="forms">
    <form action="${pageContext.request.contextPath}/auction/selectFuzzy">
    <label for="name">名称</label>
    <input  type="text" class="nwinput" id="name" name="auctionName"/>
    <label for="names">描述</label>
    <input  type="text" id="names" class="nwinput" name="auctionDesc"/>
    <label for="time">开始时间</label>
    <input  type="text" id="time" class="nwinput" name="auctionStartTime"/>
    <label for="end-time">结束时间</label>
    <input  type="text" id="end-time" class="nwinput" name="auctionEndTime"/>
    <label for="price">起拍价</label>
    <input  type="text" id="price" class="nwinput" name="auctionUpset"/>
    <input  type="submit"  value="查询" class="spbg buttombg f14  sale-buttom"/>
    <input type="button"  value="发布" class="spbg buttombg f14  sale-buttom buttomb"/>
    </form>
  </div>
  <div class="items">
      <ul class="rows even strong">
        <li>名称</li>
        <li class="list-wd">描述</li>
        <li>开始时间</li>
        <li>结束时间</li>
        <li>起拍价</li>
        <li class="borderno">操作</li>
      </ul>


      <c:forEach items="${auctions}" var="auction">
          <ul class="rows">
            <li><a href="#" title="">${auction.auctionName}</a></li>
            <li class="list-wd">${auction.auctionDesc}</li>
            <li>${auction.auctionStartTime}</li>
            <li>${auction.auctionEndTime}</li>
            <li>${auction.auctionStartPrice}</li>
            <li class="borderno red">
               <a href="${pageContext.request.contextPath}/auction/selectToBid?selectToBidId=${auction.auctionId}">竞拍</a>
               <a href="${pageContext.request.contextPath}/auction/selectById?selectId=${auction.auctionId}" title="修改" onclick="dele();">修改</a>|
              <a href="${pageContext.request.contextPath}/auction/deleteById?deleteId=${auction.auctionId}" title="删除" onclick="abc();">删除</a>
            </li>
          </ul>
      </c:forEach>



      <div class="page">
        <a href="${pageContext.request.contextPath}/auction/show?PageNum=1" title="">首页</a>
        <c:if test="${pageNum==1}">
          上一页
        </c:if>
        <c:if test="${pageNum>1}">
        <a href="${pageContext.request.contextPath}/auction/show?PageNum=${pageNum-1}" title="">上一页</a>
        </c:if>
        <span class="red">前3页</span>
        <a href="${pageContext.request.contextPath}/auction/show?PageNum=1" title="">1</a>
        <a href="${pageContext.request.contextPath}/auction/show?PageNum=2" title="">2</a>
        <a href="${pageContext.request.contextPath}/auction/show?PageNum=3" title="">3</a>
        <c:if test="${pageNum==totalPage}">
          下一页
        </c:if>
        <c:if test="${pageNum<totalPage}">
        <a href="${pageContext.request.contextPath}/auction/show?PageNum=${pageNum+1}" title="">下一页</a>
        </c:if>
        <a href="${pageContext.request.contextPath}/auction/show?PageNum=${totalPage}" title="">尾页</a>
      </div>
  </div>



  <script>
   function abc(){
	   
	   if(confirm("你真的确认要删除吗？请确认")){
	    
		   return true;
		 }
		 else{
			 return false;
			 }
			 
	   };
	   function dele(){
		   if(confirm("你真的确认要修改吗？请确认")){
			   return true;
			   }
			   else{
				   return false;
				   }
		   }
  </script>
<!-- main end-->
</div>
</body>
</html>